/*
 * @Date: 2024-07-11 14:49:26
 * @Autor: 叶世超
 * @LastEditors: 叶世超 yesc163@163.com
 * @LastEditTime: 2024-07-16 09:45:32
 * @FilePath: \reslib-web\src\api\knowledge\character\index.ts
 * @Description: 描述
 * @version: 版本
 */

import request from '@/config/axios'
/* 人物图谱 */

// 分页查询
export const getGraphEntityPage = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEntityPage', params })
}
// 根据ID查询
export const getGraphEntity = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEntity', params })
}
// 相关图谱（图谱节点关系数据）
export const findNeo4jByEntity = async (params) => {
  return await request.get({ url: '/knowledgeGraph/findNeo4jByEntity', params })
}
// 图谱模糊查询
export const findNeo4jSlurByEntity = async (params) => {
  return await request.get({ url: '/knowledgeGraph/findNeo4jSlurByEntity', params })
}
// 实体取消发布
export const updateGraphEntityReleaseStatus0 = async (params) => {
  // return await request.get({ url: '/knowledgeGraph/upateGraphEntitRreleaseStatus0', params })
  return await request.get({ url: '/knowledgeGraph/updateGraphEntityReleaseStatus0', params })
}
// 实体发布
export const updateGraphEntityReleaseStatus1 = async (params) => {
  // return await request.get({ url: '/knowledgeGraph/upateGraphEntitRreleaseStatus1', params })
  return await request.get({ url: '/knowledgeGraph/updateGraphEntityReleaseStatus1', params })
}
// 新增实体
export const insertHybaseGraphEntity = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/insertHybaseGraphEntity', data: params })
}
// 修改实体
export const updateHybaseGraphEntity = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/updateHybaseGraphEntity', data: params })
}
// 删除实体
export const deleteHybaseGraphEntity = async (params) => {
  return await request.get({ url: '/knowledgeGraph/deleteHybaseGraphEntity' + '?ids=' + params })
}
// 修改实体之间的关系（关系维护）（旧）
export const updateRelationByCode = async (params) => {
  return await request.post({ url: 'knowledgeGraph/updateRelationByCode', data: params })
}
// 修改实体之间的关系（关系维护）（新）
export const updateRelationAndFeatureByCode = async (params) => {
  return await request.post({
    url: 'knowledgeGraph/updateRelationAndFeatureByCode  ',
    data: params
  })
}
// 修改关联实体名称（节点维护）
export const updateFeatureByCode = async (params) => {
  return await request.post({ url: 'knowledgeGraph/updateFeatureByCode', data: params })
}
// 删除实体的关系及关联实体但不删除主实体
export const deleteRelationByEntityAndFeature = async (params) => {
  return await request.post({
    url: 'knowledgeGraph/deleteRelationByEntityAndFeature',
    data: params
  })
}
// 关系抽取-提交（添加关系）
export const insertNeo4j = async (params) => {
  return await request.post({ url: '/knowledgeGraph/insertNeo4j', data: params })
}
// 关联节点发布
export const updateFeatureReleaseStatusByFeatureCode = async (params) => {
  return await request.post({ url: '/knowledgeGraph/updateFeatureReleaseStatusByFeatureCode', data: params })
}
// 根据实体名查询关联关系
// export const findNeo4jByEntity = async (params) => {
//   return await request.get({ url: '/knowledgeGraph/findNeo4jByEntity', params })
// }
// 根据实体名查询数据
export const getGraphEntityByName = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEntityByName', params })
}

// 事件图谱单独接口，不走entityType字段切换
// 分页接口
export const getGraphEventPage = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEventPage', params })
}
// 新增
export const insertHybaseGraphEvent = async (params) => {
  return await request.post({ url: '/knowledgeGraph/insertHybaseGraphEvent', data: params })
}
// 修改
export const updateHybaseGraphEvent = async (params) => {
  return await request.post({ url: '/knowledgeGraph/updateHybaseGraphEvent', data: params })
}
// 根据ID查询
export const getGraphEventById = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEventById', params })
}
// 删除实体
export const deleteHybaseGraphEvent = async (params) => {
  return await request.get({ url: '/knowledgeGraph/deleteHybaseGraphEvent' + '?ids=' + params })
}
// 实体取消发布
export const updateGraphEventReleaseStatus0 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphEventReleaseStatus0', params })
}
// 实体发布
export const updateGraphEventReleaseStatus1 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphEventReleaseStatus1', params })
}
// 地点图谱单独接口，不走entityType字段切换
// 分页接口
export const getGraphPlacePage = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphPlacePage', params })
}
// 新增
export const insertHybaseGraphPlace = async (params) => {
  return await request.post({ url: '/knowledgeGraph/insertHybaseGraphPlace', data: params })
}
// 修改
export const updateHybaseGraphPlace = async (params) => {
  return await request.post({ url: '/knowledgeGraph/updateHybaseGraphPlace', data: params })
}
// 删除实体
export const deleteHybaseGraphPlace = async (params) => {
  return await request.get({ url: '/knowledgeGraph/deleteHybaseGraphPlace' + '?ids=' + params })
}
// 实体取消发布
export const updateGraphPlaceReleaseStatus0 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphPlaceReleaseStatus0', params })
}
// 实体发布
export const updateGraphPlaceReleaseStatus1 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphPlaceReleaseStatus1', params })
}
// 分页展示地点
export const getGraphEventPageByPlace = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEventPageByPlace', params })
}
// 时间图谱单独接口，不走entityType字段切换
// 分页接口
export const getGraphTimePage = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphTimePage', params })
}
// 新增
export const insertHybaseGraphTime = async (params) => {
  return await request.post({ url: '/knowledgeGraph/insertHybaseGraphTime', data: params })
}
// 修改
export const updateHybaseGraphTime = async (params) => {
  return await request.post({ url: '/knowledgeGraph/updateHybaseGraphTime', data: params })
}
// 删除实体
export const deleteHybaseGraphTime = async (params) => {
  return await request.get({ url: '/knowledgeGraph/deleteHybaseGraphTime' + '?ids=' + params })
}
// 实体取消发布
export const updateGraphTimeReleaseStatus0 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphTimeReleaseStatus0', params })
}
// 实体发布
export const updateGraphTimeReleaseStatus1 = async (params) => {
  return await request.get({ url: '/knowledgeGraph/updateGraphTimeReleaseStatus1', params })
}
// 分页展示时间
export const getGraphEventPageByTime = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEventPageByTime', params })
}
// 初始化分页展示时间
export const getGraphEventPageByTimeInitialize = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphEventPageByTimeInitialize', params })
}
// 节点维护导入接口
export const readExcelAndUpdateEntity = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/readExcelAndUpdateEntity', data: params })
}
// 知识库导入接口
export const uploadExcelAndInsertKnowledge = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/uploadExcelAndInsertKnowledge', data: params })
}
// 图谱关系闭环验证接口
export const findNeo4jClosedLoop = async (params) => {
  return await request.get({ url: '/knowledgeGraph/findNeo4jClosedLoop', params })
}
// 图谱知识库导入接口（限制只能上传txt文件）
export const insertHybaseAndNeo4jByStr = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/insertHybaseAndNeo4jByStr', data: params })
}
// 图谱知识库导入接口（限制只能上传xls或xlsx 文件）
export const insertHybaseAndNeo4jByExcel = async (params) => {
  return await request.upload({ url: '/knowledgeGraph/insertHybaseAndNeo4jByExcel', data: params })
}

// 可视化关系维护-实体关系
export const getGraphOptionRelationName = async (params) => {
  return await request.get({ url: '/knowledgeGraph/getGraphOptionRelationName', params })
}
